﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace Project5.Models
{

    public class SurveyModel
    {
        public int Id { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "Title")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "Owner")]
        public string Originator { get; set; }

        [Required]
        [Display(Name = "State")]
        public int State { get; set; } //0=under work, 1=active, 2=inactive

        public int View { get; set; } //0 = not viewable, 1 = viewable

        [Required]
        [Display(Name = "Monetized Survey")]
        public bool Monetized { get; set; }

        [Required]
        [Display(Name = "Creation Date")]
        public string createDate { get; set; }

        [Display(Name = "Activation Date")]
        public string activationDate { get; set; }

        [Display(Name = "Closed Date")]
        public string closeDate { get; set; }

        [Display(Name = "Proctor")]
        public virtual List<ProctorModel> Proctors { get; set; }

    }

    public class ProctorModel
    {
        public int Id { get; set; }

        [Display(Name = "Proctor")]
        public string Name { get; set; }

        [Required]
        public int SurveyID { get; set; }
    }

    public class QuestionModel
    {
        public int Id { get; set; }
        
        [Required]
        public int SurveyId { get; set; }

        [Required]
        [Display(Name = "Question Text")]
        public string Question { get; set; }

        [Required]
        [Display(Name = "Question Type")]
        public int Type { get; set; } //1=Text Response, 2=Mult Choice, 3=T/F

        public List<ChoiceModel> Choices { get; set; }
    }

    public class ChoiceModel
    {
        public int Id { get; set; }

        public int QuestionId { get; set; }

        [Required]
        public string Choice { get; set; }
    }

    public class ResponseModel
    {
        public int Id { get; set; }

        [Required]
        public int sessionId { get; set; }

        [Required]
        public int SurveyId { get; set; }

        [Required]
        public int QuestionId { get; set; }
        //public int RespondentId { get; set; }

        [Required]
        public string QuestionText { get; set; }

        [Required]
        public int Type { get; set; }//1=Text Response, 2=Mult Choice, 3=T/F

        //Response, text, choice selected or "true" or "false" depending on question type
        [Display(Name = "Response")]
        public string Response { get; set; }

    }

    public class PaymentModel
    {

        public int Id { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "Surveytool Username")]
        public string userName { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "PayPal Username")]
        public string PayPalUsername { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "PayPal Password")]
        public string PayPalPassword { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "PayPal Signature")]
        public string PayPalSignature { get; set; }

        [Required]
        [DataType(DataType.Text)]
        [Display(Name = "PayPal ID")]
        public string PayPalId { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "PayPal Email")]
        public string PayPalEmail { get; set; }

        [Required]
        [DataType(DataType.Currency)]
        [Display(Name = "Survey Payment Amount (USD)")]
        public double PaymentAmount { get; set; }
    }
}